package com.stepshop.wechat.thread;

public class TimeTest2 {
	public static void main(String[] args) {
//		Thread thread=new Thread(new SynTimer2());
//		thread.start();
		testSyn();
		testSyn();
	}
	public static  void testSyn(){
		System.out.println("------------------------------");
		synchronized (OnlyPatnerSynLocker.getLocker()) {
			for(int i=0;i<100;i++){
				try {
					Thread.currentThread().sleep(500);
					if(i==40){
						int p=1/0;
					}
				} catch (Exception e) {
					e.printStackTrace();
				}
				System.out.println("this."+i);
				synchronized (OnlyPatnerSynLocker.getLocker()) {
					System.out.println("this.锁"+i);
				}
			}
		}
	}
}
